﻿using InnoWeb.CEND.Core.Model.Training;
using InnoWeb.CEND.Data.Mapping.BaseMapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnoWeb.CEND.Data.Mapping.Training
{
    public class TrainingContentMapping : BaseMappingConfiguration<TrainingContent, int>
    {
        public TrainingContentMapping()
        {
            this.Property(a => a.Text).IsRequired().HasMaxLength(300);
            this.Property(a => a.TextTR).IsRequired().HasMaxLength(300);
            this.Property(a => a.VideoUrl).IsOptional();

            this.Property(a => a.TrainingItemId);
            this.HasRequired(a => a.TrainingItem).WithMany(a => a.TrainingContents).HasForeignKey(a => a.TrainingItemId);
        }
    }
}
